from django.db import models
from conference.models import Conference
from person.models import Person
from danwei.models import Danwei

# Create your models here.
class AttendType(models.TextChoices):  # 参会情况
    邀请 = "邀请"
    参会 = "参会"
    请假 = "请假"
    出席 = "出席"
    列席 = "列席"

class NoticeType(models.TextChoices):  # 会议类型
    已读 = "已读"
    未读 = "未读"
    删除 = "删除"


class ConferenceSituation(models.Model):  # 议题
    id = models.AutoField(primary_key=True)
    conference_id = models.ForeignKey(
        Conference,
        on_delete=models.CASCADE,
        related_name="conference_situation",
        blank=True,
        null=True,
    )
    person_id=models.ForeignKey(
        Person,
        on_delete=models.CASCADE,
        related_name="conference_situation",
        blank=True,
        null=True,
    )
    danwei_id=models.ForeignKey(
        Danwei,
        on_delete=models.CASCADE,
        related_name="conference_situation",
        blank=True,
        null=True,
    )
    attend = models.CharField(
        max_length=6,
        choices=AttendType.choices,
        default=AttendType.邀请,
        blank=True,
        null=True,
    )
    notice = models.CharField(
        max_length=6,
        choices=NoticeType.choices,
        default=NoticeType.未读,
        blank=True,
        null=True,
    )
    